package infiews;

import infiews.crawler.Crawler;
import infiews.web.Site;

public class Main {
	public static void main(String[] args){
		try{
			Crawler crawler = new Crawler();

            Site site = new Site("lenta.ru");
            site.setStartUrl("http://lenta.ru");
            site.setPattern("http:\\/\\/lenta\\.ru\\/.*\\/");
            site.setEncoding("windows-1251");
            site.setXPath("td[@id='article']");
            site.setUseXPath(true);
            site.setDeep(2);
            site.setActive(false);

            Site site2 = new Site("tut.by");
			site2.setStartUrl("http://tut.by");
			site2.setPattern( "http:\\/\\/news\\.tut\\.by\\/[a-z]*\\/[0-9]*\\.html" );
			site2.setXPath("//div[@class='article clearfix']");
			site2.setUseXPath(true);
			site2.setActive(true);

          /*  Site site3 = new Site("interfax.by");
            site3.setStartUrl("http://interfax.by");
            site3.setPattern("http:\\/\\/interfax\\.by\\/.*");
            site3.setDeep(2);
            site3.setActive(true);
*/
			crawler.updateSite(site);
            crawler.updateSite(site2);
           // crawler.updateSite(site3);
			crawler.start();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
